<?php 
$resume = new Default_Model_ExperienceMapper();
$listFunction = $resume->getFunction();

$resume = new Default_Model_ResumeMapper();
$listProvince = $resume->getProvince();
?>
<div style="width:900px;height: 450px; overflow-y:scroll;display: none;" id="inline">
<div id="adv-search" class="content">
<div align="center" style="color:#1B7CBD;font-size:16px"><b>ADVANCED SEARCH</b></div>
<br/>
<form name="frmAvanSearch" id="frmAvanSearch" method="post" action="/resume/avandce-search" >
    <ul>
        <li style="width: 800px;">
            <label>Search Keyword</label>
            <input type="text" name="keyword" id="keyword" value="" style="width:500px"/>
            <i>(Just for Experience)</i>
        </li>
    </ul>
	<h2>Search Personal Details</h2>
	<ul>
		<li>
			<label>Candidate Name</label>
			<input type="text" name="full_name" id="full_name" value="" />
		</li>
		<li>
			<label>Email</label>
			<input type="text" name="email" id="email" value="" />
		</li>                    
		<li>
			<label>Phone</label>
			<input type="text" name="phone" id="phone" value="" />
		</li>
		<li>
			<label>Gender</label>
            <input type="radio" name="gender" value="male" /> <span>Male</span>
			<input type="radio" name="gender" value="female" /> <span>Female</span>
            <input type="radio" name="gender" value="0" /> <span>Both</span>
		</li>
		<li>
			<label>Marital Status</label>
			<input type="radio" name="marital_status" value="single" /> <span>Single</span>
			<input type="radio" name="marital_status" value="mrried" /> <span>Married</span>
			<input type="radio" name="marital_status" value="divorced" /> <span>Divorced</span>
            &nbsp;&nbsp;<input type="radio" name="marital_status" value="0" /> <span>All</span>
		</li>

	</ul>

	<h2>SEARCH EXPERIENCE, SALARY, WORK LOCATION</h2>
	<ul>
		<li>
			<label>Job Title</label>
			<input type="text" name="job_title" id="job_title" value="" />
		</li>
		<li>
			<label>Salary</label>
			<select name="symbol" id="symbol" style="width: 60px">
				<option value="1">=</option>
				<option value="2"> &gt; </option>
				<option value="3"> &lt; </option>
			</select> 
			<input class="cost" type="text" name="salary" id="salary" value="" /> <span style="float:none !important; ">USD</span>
		</li>
		<li>
			<label>Company</label>
			<input type="text" name="company_name" id="company_name" value="" />
		</li>                    
		<li>
			<label>Experience Other</label>
			<input type="text" name="experother" id="experother" value="" />
		</li>
		<li>
			<label>Function</label>
			<input type="text" name="function" id="function" class="function" value=""/>
			<div class="multiselect" style="width:800px; height:250px; padding:10px;display:none; position:absolute">
				<div style="width: 33%; float: left">
					<ul style="list-style-type:none;margin: 10px 0;">
					<?php 
					$i = 1;
					foreach($listFunction as $function) :
						if($i % 23 == 0): echo '</ul></div><div style="width: 33%; float: left"><ul style="list-style-type:none;margin: 10px 0;">';endif;
						if($function['parent_function_id'] == 0) echo '<div><strong>'. $function['name'] .'</strong></div>';
						//if(in_array($function['function_id'], $this->experFunction, true)) $checked = "checked";
						//else $checked = '';
					?>
						<?php if($function['parent_function_id'] != 0):?>
						<li style="float:none;display:block;"><input type="checkbox" name="function[]" value="<?php echo $function['function_id']?>" />&nbsp; <?php echo $function['name']?></li>
						<?php endif;?>	
					<?php 
					$i++;
					endforeach;?>
					</ul>
				</div>
				<div style="clear: both">&nbsp;</div>
			</div>
		</li>
		<li>
			<label>Expected Location</label>
			<input class="province" type="text" name="province" id="province"  value="" />
            <div class="multiselect1" style="padding:10px;display:none; position:absolute">
				<div style="width:33%; float:left">
                <ul style="list-style-type:none;margin: 10px 0;">
				<?php 
				$i = 1;
				foreach($listProvince as $province) :
					if($i % 22 == 0): echo '</ul></div><div style="width:33%; float:left"><ul style="list-style-type:none;margin: 10px 0;">';endif;
					//if(in_array($province['province_id'], $this->resumeProvince, true)) $checked = "checked";
					//else $checked = '';
				?>
                    <li style="float:none;display:block;"><input type="checkbox" name="province[]" value="<?php echo $province['province_id']?>"/>&nbsp; <?php echo $province['name']?></li>
						
				<?php 
				$i++;
				endforeach;?>
                </ul>
            	</div>
            </div>
		</li>
	</ul>
    
    <h2>SEARCH EDUCATION</h2>
    <ul>
        <li>
            <label>School Name</label>
            <input type="text" name="school_name" id="school_name" value="" />
        </li>
        <li>
            <label>Program Name</label>
            <input type="text" name="program_name" id="program_name" value="" />
        </li>
    </ul>
	<div class="actions">
		<input type="button" class="button02" name="cancel" id="cancel" value="Cancel"  onclick="event.preventDefault(); parent.$.fancybox.close();">
		<input type="button" class="button01" name="avansearch" id="avansearch" value="Search">
	</div>
</form>
</div>
</div>
<script>
$(document).ready(function(){
	//click chekcbox in mutiselect
	$('.multiselect').bind('click', function() {
		var str = '';
		$(':checkbox[name^=function]').each(function(){
			if($(this).attr('checked')){
				str = str + $(this).parent().text() + ';';
			} 
		});
		str = str.slice(0, -1)
		$('.function').val(str);
	});

	//click chekcbox in mutiselect
	$('.multiselect1').bind('click', function() {
		var str = '';
		$(':checkbox[name^=province]').each(function(){
			if($(this).attr('checked')){
				str = str + $(this).parent().text() + ';';
			} 
		});
		str = str.slice(0, -1)
		$('.province').val(str);
	});
});
</script>